<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 当真个页面加载完之后再执行大括号里面的代码
        window.onload = function () {
            document.getElementById('div01').style.color = 'blue';
            document.getElementById('div01').style.width = '300px';
            document.getElementById('div01').style.height = '100px';
        }
    </script>
</head>
<body>
    <div id="div01" style="color: chartreuse; background: black;">
        你站在此处不要走动<br>我去给你买几个橘子
    </div>
</body>
</html>